/*
 * Copyright (c) 2024. hallele, Inc All rights reserved.
 */

package cn.hallele.ms.demo.api.controller;

import cn.hallele.ms.demo.api.das.PostDBDas;
import cn.hallele.ms.demo.api.dto.TypiDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 要实现 XXX SDK中 api接口，demo就不写了
 *
 * @author anle5
 * @since 2024/9/15 16:34
 */
@Slf4j
@RestController
@RequestMapping("typicode")
public class PostController {
    @Autowired
    private PostDBDas postDBDas;

    @GetMapping("posts/{id}")
    public List<TypiDTO> queryPosts(@PathVariable("id") Integer id){
        return postDBDas.querySomebodyPosts(id);
    }
}
